Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update prisma monorepo to v6 (major) #147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

daniel-renovator[bot]
Copy link
Contributor

This PR contains the following updates:

Package Type Update Change
@prisma/client (source) dependencies major 5.22.0 -> 6.1.0
prisma (source) devDependencies major 5.22.0 -> 6.1.0

Release Notes

prisma/prisma (@​prisma/client)

v6.1.0

Compare Source

Today we're releasing Prisma ORM version 6.1.0

In this version our tracing Preview feature is being graduated to GA!

Highlights
Tracing goes GA

The tracing Preview feature is now stable. You now no longer have to include tracing in your set of enabled preview features.

generator client {
   provider        = "prisma-client-js"
-  previewFeatures = ["tracing"]
}

We have also changed some of the spans generated by Prisma Client. Previously, a trace would report the following spans:

prisma:client:operation
prisma:client:serialize
prisma:engine
prisma:engine:connection
prisma:engine:db_query
prisma:engine:serialize

Now, the following are reported:

prisma:client:operation
prisma:client:serialize
prisma:engine:query
prisma:engine:connection
prisma:engine:db_query
prisma:engine:serialize
prisma:engine:response_json_serialization

Additionally, we have made a few changes to our dependencies:

  • @opentelemetry/api is now a peer dependency instead of a regular dependency
  • registerInstrumentations in @opentelemetry/instrumentation is now re-exported by @prisma/instrumentation

After upgrading to Prisma ORM 6.1.0 you will need to add @opentelemetry/api to your dependencies if you haven't already:

npm install @​opentelemetry/api

You will also no longer need to have @opentelemetry/instrumentation if you only use registerInstrumentations. In this case you can import registerInstrumentations from @prisma/instrumentation

- import { PrismaInstrumentation } from '@​prisma/instrumentation'
+ import { PrismaInstrumentation, registerInstrumentations } from '@​prisma/instrumentation'
Mutli-line comments in Prisma Schema Language (PSL)

Comments can now be defined as multi-line in your Prisma schema! Comments can use the existing format:

// this is a schema comment

or can now also use our multi-line format:

/*
 * this is a multi-line comment
 * You can add in all you want here
 * Keep typing and this comment will keep on going
 */
Bug fixes
Tracing related

As we're moving our tracing preview to GA, a number of issues have been resolved. Here are a few highlights:

Other issues

We also have a number of other issues that were resolved outside of our tracing feature.

Fixes and improvements
Prisma
Prisma Client

v6.0.1

Compare Source

Today we are releasing the 6.0.1 patch release to address an issue with using Prisma Client generated in a custom output path with Next.js.

Changes

v6.0.0

Compare Source

We’re excited to share the Prisma ORM v6 release today 🎉

As this is a major release, it includes a few breaking changes that may affect your application. Before upgrading, we recommend that you check out our upgrade guide to understand the impact on your application.

If you want to have an overview of what we accomplished since v5, check out our announcement blog post: Prisma 6: Better Performance, More Flexibility & Type-Safe SQL.

🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release.

Breaking changes

⚠️ This section contains a list of breaking changes. If you upgrade your application to Prisma ORM v6 without addressing these, your application is going to break! For detailed upgrade instructions, check out the upgrade guide. ⚠️ 

Minimum supported Node.js versions

The new minimum supported Node.js versions for Prisma ORM v6 are:

  • for Node.js 18 the minimum supported version is 18.18.0
  • for Node.js 20 the minimum supported version is 20.9.0
  • for Node.js 22 the minimum supported version is 22.11.0

There is no official support for Node.js <18.18.0, 19, 21, 23.

Minimum supported TypeScript version

The new minimum supported TypeScript version for Prisma ORM v6 is: 5.1.0.

Schema change for implicit m-n relations on PostgreSQL

If you're using PostgreSQL and are defining implicit many-to-many relations in your Prisma schema, Prisma ORM maintains the relation table for you under the hood. This relation table has A and B columns to represent the tables of the models that are part of this relation.

Previous versions of Prisma ORM used to create a unique index on these two columns. In Prisma v6, this unique index is changing to a primary key in order to simplify for the default replica identity behaviour.

If you're defining implicit m-n relations in your Prisma schema, the next migration you'll create will contain ALTER TABLE statements for all the relation tables that belong to these relations.

Full-text search on PostgreSQL

The fullTextSearch Preview feature is promoted to General Availability only for MySQL. This means that if you're using PostgreSQL and currently make use of this Preview feature, you now need to use the new fullTextSearchPostgres Preview feature.

Usage of Buffer

Prisma v6 replaces the usage of Buffer with Uint8Array to represent fields of type Bytes. Make sure to replace all your occurrences of the Buffer type with the new Uint8Array.

Removed NotFoundError

In Prisma v6, we removed the NotFoundError in favor of PrismaClientKnownRequestError with error code P2025 in findUniqueOrThrow() and findFirstOrThrow(). If you've relied on catching NotFoundError instances in your code, you need to adjust the code accordingly.

New keywords that can't be used as model names: async, await, using

With this release, you can't use async, await and using as model names any more.


⚠️ For detailed upgrade instructions, check out the upgrade guide. ⚠️ 

Preview features promoted to General Availability

In this release, we are promoting a number of Preview features to General Availability.

fullTextIndex

If you use the full-text index feature in your app, you can now remove fullTextIndex from the previewFeatures in your Prisma schema:

generator client {
  provider        = "prisma-client-js"
- previewFeatures = ["fullTextIndex"]
}
fullTextSearch

If you use the full-text search feature with MySQL in your app, you can now remove fullTextSearch from the previewFeatures in your Prisma schema:

generator client {
  provider        = "prisma-client-js"
- previewFeatures = ["fullTextSearch"]
}

If you are using it with PostgreSQL, you need to update the name of the feature flag to fullTextSearchPostgres:

generator client {  
  provider        = "prisma-client-js"
- previewFeatures = ["fullTextSearch"]  
+ previewFeatures = ["fullTextSearchPostgres"]
}
New features

We are also releasing new features with this release:

Company news
🚀 Prisma Postgres is free during Early Access

In case you missed it: We recently launched Prisma Postgres, a serverless database with zero cold starts, a generous free tier, connection pooling, real-time events, and a lot more! It’s entirely free during the Early Access phase, try it now!

✨ Let us know what you think of Prisma ORM

We're always trying to improve! If you've recently used Prisma ORM, we'd appreciate hearing your thoughts about your experience via this 2min survey.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

Copy link

coderabbitai bot commented Dec 18, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.16%. Comparing base (a6afa67) to head (4ee52a2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #147   +/-   ##
=======================================
  Coverage   34.16%   34.16%           
=======================================
  Files          26       26           
  Lines         600      600           
  Branches       93       93           
=======================================
  Hits          205      205           
- Misses        382      395   +13     
+ Partials       13        0   -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daniel-renovator daniel-renovator bot force-pushed the renovate/major-prisma-monorepo branch from 657b5ab to 4ee52a2 Compare December 23, 2024 15:27
@danielemery
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants